<template>
    <div class="loginbBody">
        <div class="loginDiv">
            <div class="login-content">
                <h1 class="login-title">后台登录</h1>
                <el-form :model="loginForm" label-width="100px"
                         :rules="rules" ref="loginForm">
                    <el-form-item label="名字" prop="name">
                        <el-input style="width: 200px" type="text" v-model="loginForm.name"
                                  autocomplete="off" size="small"></el-input>
                    </el-form-item>
                    <el-form-item label="密码" prop="password">
                        <el-input style="width: 200px" type="password" v-model="loginForm.password"
                                  show-password autocomplete="off" size="small"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="confirm">确 定</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>

<script >
	import axios from 'axios'
    export default {
        name: "login",
        data(){
            return{
                loginForm:{
                    name:'',
                    password:''
                },
                rules:{
                  
                }
            }
        },
        methods:{
            confirm(){
				console.log(JSON.stringify(this.loginForm))
				axios({
					method: "post",
					url:"http://localhost:8081/login",
					data: JSON.stringify(this.loginForm),
						headers: {'Content-Type': 'application/json;charset=UTF-8'}
				}).then((res) => {
					console.log(res.data)
				})
            }
        }
    }
</script>

<style scoped >
    .loginbBody {
        width: 100%;
        height: 100%;
        background-color: #B3C0D1;
    }
    .loginDiv {
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -200px;
        margin-left: -250px;
        width: 450px;
        height: 330px;
        background: #fff;
        border-radius: 5%;
		boder-style:solid;
		background-color: #B3C0D1;

    }
    .login-title {
        margin: 20px 0;
        text-align: center;
    }
    .login-content {
        width: 400px;
        height: 250px;
        position: absolute;
        top: 25px;
        left: 25px;
    }
</style>
